
#ifndef __ENCRYPT_WRAPPER_H
#define __ENCRYPT_WRAPPER_H

#include "EncryptionKey.h"
#include "SigningKey.h"
#include "../aprtools/APRBucketBrigade.h"

// Add in support for symmetric keys too

/** Wrapper for generating and managing encryption processes. */
class EncryptWrapper
{
   public:
      EncryptWrapper(EncryptionKey *enckey);
      EncryptWrapper(EncryptionKey *enckey, SigningKey *sgnkey);
      EncryptWrapper(EncryptionKey *enckey, int compress);
      EncryptWrapper(EncryptionKey *enckey, SigningKey *sgnkey, int compress);
      ~EncryptWrapper();
      std::vector<char> *encryptBuffer(const char *buffer, size_t length);
      APRBucketBrigade *encryptToBucket(APRBucketBrigade *bbrgde);
   private:
      void initEncryptWrapper(EncryptionKey *enckey, SigningKey *sgnkey, int compress);
      /** Key to be used for encryption. */
      EncryptionKey *enckeycopy;
      /** Key to be used for signing data. */
      SigningKey *sgnkeycopy;
      /** A flag holding whether to add a compression envelope to the process. */
      int docompress;
      /** A flag to say whether to add signatures to the data. */
      int trusted;
      /** The APR memory pool for creating bucket brigades. */
      apr_pool_t *mp;
};

#endif
